package com.dshore.messagecenter.controller.basedata;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

	/**
	 * 应用管理
	 * @author Administrator
	 *
	 */
	@Controller
	@RequestMapping("/app")
	public class AppliController {
		 /* *
		  * 返回页面 
		 */
		  @RequestMapping("/tosee")
		  public ModelAndView page() {
			  ModelAndView mv = new ModelAndView("basedata/app");
			  return mv;
		}
		  /**
		   * 带参页面
		   * @param param
		   * @param key session中的值
		   * @param id 目标应用id(用于更换使用)
		   * @return
		   */
			@RequestMapping("/toseeByParam")
			public ModelAndView insertUser(String param,
			@RequestParam(value = "key",required = false) String key,
			@RequestParam(value = "index",required = false) String index){
			  ModelAndView mv = new ModelAndView("app");
			  mv.addObject("param", param);
			  mv.addObject("key",key);
			  mv.addObject("index",index);
			  return mv;
		   }
		/**
		 * 带参页面(服务接入源应用）
		 *  @param param
		 * @param key session中的值
		 * @return
		 */
		@RequestMapping("/toseeByService")
		public ModelAndView addService(String param,
			@RequestParam(value = "key",required = false) String key){
				ModelAndView mv = new ModelAndView("app");
				mv.addObject("param", param);
				mv.addObject("key",key);
				return mv;
			}
		/**
		 * 带参页面(服务接入源应用）
		 * @param param
		 * @param key session中的值
		 * @return
		 * num表示目标应用的下表，根据下表判断session是否存在该应用集
		 */
		@RequestMapping("/toByTargetApp")
		public ModelAndView toByTargetApp(String param,@RequestParam(value = "num",required = false)String num,
			@RequestParam(value = "key",required = false) String key){
			ModelAndView mv = new ModelAndView("app");
			mv.addObject("param", param);
			mv.addObject("key",key);
			mv.addObject("num",num);
			return mv;
		}
}
